Page({
  /**
   * 页面的初始数据
   */
  data: {

    todoList: ['吃饭', '睡觉', '写代码']
  },
  onSubmit(e) {
    const list = this.data.todoList
    list.push(e.mark.a)
    this.setData({
      todoList: list
    })
    wx.showToast({
      title: '提交成功',
    })


  },
  onDelete(index) {
    const list = this.data.todoList
    list.splice(index.mark.a, 1)
    this.setData({
      todoList: list
    })


  },
  allDelete() {
    this.setData({
      todoList: []
    })
  }

})
